The invention relates to an apparatus comprising an optical input device controlled by a moving object and an optical keyboard, which input device comprises at least one optical sensor unit comprising a diode laser for supplying a measuring beam and converting means for converting measuring beam radiation reflected by the object into an electric signal, which converting means are constituted by the combination of a laser cavity and measuring means for measuring changes in operation of the laser cavity, which are due to interference of reflected measuring beam radiation re-entering the laser cavity and the optical wave in this cavity and which are representative of the movement of the object.